package 测试;

import java.util.LinkedList;
import java.util.List;

public class HelloWorld {
    void getAll(List<List<Integer>> list, List<Integer> now, int[] nums, int[] visited) {
        // 结束条件
        if(nums.length == now.size()){
            List<Integer> t = new LinkedList<>();
            for(int n: now)
                t.add(n);
            list.add(t);
            return;
        }
        //
        for(int i =0;i<nums.length;i++){
            if(visited[i]==0){
                visited[i]=1;
                now.add(nums[i]);
                getAll(list,now,nums,visited);
                // 恢复现场
                visited[i]=0;
                now.remove(now.size()-1);
            }
        }

    }
    public static void main(String[] args) {
        System.out.println("hello world");
    }
}
